import { request } from "../network/request";

export function getDepartment() {
  return request({
    url: "/getDept",
    method: "GET",
  });
}

export function addDepartment({ title, type, teacher }) {
  return request({
    url: "/addDept",
    method: "POST",
    data: {
      title: title,
      type: type,
      teacher: teacher,
    },
  });
}

export function delDepartment({ id }) {
  return request({
    url: "/delDept",
    method: "POST",
    data: {
      _id: id,
    },
  });
}

export function editDepartment({ title, type, teacher, _id }) {
  return request({
    url: "/editDept",
    method: "POST",
    data: {
      title: title,
      type: type,
      teacher: teacher,
      _id: _id,
    },
  });
}
